package com.dm.learn.java.pattern.productor_consumer1;

public class Productor implements Runnable {
	ThreadManager tm;

	public Productor(ThreadManager tm) {
		this.tm = tm;
	}

	@Override
	public void run() {
		for (int i = 0; i < 50; i++) {
			try {
				// 这里sleep一秒钟表示正在生产
				Thread.sleep(1000);
				tm.product("test" + i);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

}
